package com.itheima.d3_transform_stream;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.io.*;

/**
 * 目标：掌握字符输出转换流的使用。
 */
public class Test3OutputStreamWriter {
    public static void main(String[] args) {
        try (FileOutputStream fos = new FileOutputStream("day10io-app2/file/File03.txt");
             OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
             BufferedWriter bw = new BufferedWriter(osw)
        ) {
            bw.write("《咏鹅》");
            bw.newLine();
            bw.write("老骆");
            bw.newLine();
            bw.write("曲项向天歌");
            bw.newLine();



        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
